<template>
	<view class="body__group timu__page">
		
		<template v-for="(test,index) in cats">
			<navigator :url="`/pages/dati_1/dati_1?cid=${test.cid}&cname=${test.cname}`" :key="index">
				<globalCard>
					<view>{{test.cname}}</view>
					<view>{{test.qtitle}}</view>
					<image class="lianxi-btn__item" src="../../../static/lianxi.png"></image>
					<view class="tip_1_item">我要练习</view>
				</globalCard>
			</navigator>
		</template>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				cats: [],
				login: getApp().globalData.userId
			}
		},
		created() {
			this.main();
		},
		methods: {

			async main() {
				await this.getCats()
			},

			async getCats() {
				uni.showLoading({
						title: '加载中...',
						mask: true
					})
				const [state, result] = await this.$https({
					url: '/wechat/getcats',
					method: 'GET'
				})
				uni.hideLoading()
				this.cats = result.data.data;
			},

		}
	}
</script>

<style lang="scss">
	.body__group {
		min-height: 100vh;
		padding: 20px;
	}

	// .lianxi-btn__item {
	// 	width: 25vw;
	// 	height: calc(25vw / (192 / 54));
	// 	position: absolute;
	// 	right: 20px;
	// 	bottom: 20px;
	// }

	.tip__item {
		position: fixed;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		font-size: 12px;
		color: #aaa;
	}

</style>
